package com.battle.service.repository.in;

import com.battle.pojo.entity.Organization;
import com.battle.pojo.entity.User;
import com.battle.pojo.entity.UserOrganizationMp;
import nirvana.core.repository.IRepository;
    import com.battle.pojo.dto.organization.SelectOrganizationDto;
    import com.baomidou.mybatisplus.extension.plugins.pagination.Page;

import java.util.List;
import java.util.Map;

/**
* 【描 述】：
* 【环 境】：J2SE
* 【详 细】：
*
*/
public interface OrganizationRepository extends IRepository< Organization > {


    /**
    * 搜索组织架构
    * @param dto
    * @return
    */
    Page< Organization > selectOrganization(SelectOrganizationDto dto);

    /**
     * 获取map信息
     * @param ids
     * @return
     */
    Map<Long, Organization> getMap(List<Long> ids);

    /**
     * 获取map信息
     * @param ids
     * @return
     */
    Map<UserOrganizationMp, Organization> getUserOrganizationMap(List<UserOrganizationMp> ids);

    /**
     * 根据当前id查出所有的层级，并且拼接
     * @param id
     * @return
     */
    String selectPathById(Long id,String path);

    Organization selectByName(String string);

    /**
     * 根据组织架构id获取所有该组织下面的ids
     * @param organizationId
     * @return
     */
    List<Long> getOrganizationIdList(Long organizationId);
}